package com.shrcl.engineerprocess.domain.organization

import com.shrct.businessprocess.organization.*
import edu.fudan.langlab.domain.organization.MultiValuedRoleContributor
import org.springframework.stereotype.Component
import org.springframework.beans.factory.annotation.Autowired
import java.util.Collection
import edu.fudan.langlab.domain.organization.SingleValuedRoleContributor
//@Component("RCSalesRoleContributor")
//class RCSalesRoleProvider implements MultiValuedRoleContributor {
//
//	@Autowired
//	private RCOrganizationService orgainzationService;
//	
//	override Collection<RCEmployee> getParties() {
//		orgainzationService.getRoleAssignment(roleId).map[it.employee].toSet
//	}
//
//	override getDescription() {
//		"销售"
//	}
//	
//	override getRoleId() {
//		"RCSales"
//	}
//}
@Component("EngineerTechnicalLeaderRoleProvider")
class EngineerTechnicalLeaderRoleProvider implements SingleValuedRoleContributor{
	
	@Autowired
	private RCOrganizationService orgainzationService;
	@Autowired
	private RCEmployeeDAO dao;
	override RCEmployee getParty() {
//		#[from RCEmployee as ra where ra.eid = 'admin'].uniqueresult
//		orgainzationService.getRoleAssignment(roleId).map[it.employee].toSet
		dao.findByEid('admin')
	}
	
	override getDescription() {
		"技术经理"
	}
	override getRoleId() {
		"EngineerTechnicalLeader"
	}
}

